package com.cloud.es.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(name = "cloud-es", url = "http://127.0.0.1:9200")
public interface EsFeign {
    @GetMapping("_cat/nodes?format=json")
    public String getNodes();

    @PutMapping(value = "/study",consumes = "application/json", produces = "application/json")
    public String createIndex();

    @PutMapping(value = "/study/_doc/1",consumes = "application/json", produces = "application/json")
    public String insert(@RequestBody String object);

    @GetMapping("/study/_search?format=json")
    public String query();
}
